import request from '@/utils/request';

const userApi = {};

userApi.manageWxMiniUsers = () => {
	return request({
		url: '/auth-api/user/manage-wxmini-users',
		method: 'get',
	})
}
userApi.listByRole = (roleEnName) => {
	return request({
		url: '/auth-api/user/list-role?roleEnName=' + roleEnName,
		method: 'get',
	})
}
userApi.updatePwd = (params) => {
	return request({
		url: '/auth-api/auth/update-pwd',
		method: 'put',
		data: params,
	})
}
userApi.allocateRoles = (id, params) => {
	return request({
		url: '/auth-api/user/allocate-roles/' + id,
		method: 'put',
		data: params,
	})
}
userApi.list = () => {
	return request({
		url: '/auth-api/user/list',
		method: 'get',
	})
}
userApi.page = (params) => {
	return request({
		url: '/auth-api/user/page',
		method: 'post',
		data: params,
	})
}
userApi.add = (params) => {
	return request({
		url: '/auth-api/user',
		method: 'post',
		data: params,
	})
}
userApi.update = (params) => {
	return request({
		url: '/auth-api/user',
		method: 'put',
		data: params,
	})
}
userApi.get = (id) => {
	return request({
		url: '/auth-api/user/' + id,
		method: 'get',
	})
}
userApi.delete = (id) => {
	return request({
		url: '/auth-api/user/' + id,
		method: 'delete',
	})
}


export default userApi